# from flask import session
# from flask_script import Manager
# from flask_migrate import Migrate,MigrateCommand
# # 导入程序实例
# from info import create_app,db

# #　调用工厂函数,获取程序实例app
# app = create_app('development')
#
# #　实例化管理器对象
# manage = Manager(app)
# # 使用迁移框架
# Migrate(app,db)
# # 添加添加迁移命令给管理器
# manage.add_command('db',MigrateCommand)



from config import Config
from flask_session import Session
from flask_sqlalchemy import SQLAlchemy
from flask_script import Manager
from flask_migrate import Migrate,MigrateCommand

from info import create_app, db
from info import models

app = create_app('development')

# db = SQLAlchemy(app)
# 加载配置对象
app.config.from_object(Config)


#　实例化管理器对象
manage = Manager(app)

# 使用迁移框架
Migrate(app,db)
# 添加添加迁移命令给管理器
manage.add_command('db',MigrateCommand)

Session(app)
# >>>>>>> origin/master


if __name__ == '__main__':
    print(app.url_map)
    manage.run()